import 'package:flutter/material.dart';

void main() => runApp(MyApp());

// p11-  listView
class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demoxxxx',
      home: Scaffold(
        appBar: new AppBar(title: new Text('ListView Widget')),
        body: new ListView(
          children: <Widget>[
            // 列表
            // new ListTile(
            //   leading: new Icon(Icons.access_alarms),
            //   title: new Text('perm_camera_mic'),
            // ),
            // new ListTile(
            //   leading: new Icon(Icons.airline_seat_recline_normal),
            //   title: new Text('perm_cdsdsdemera_mic'),
            // ),
            // new ListTile(
            //   leading: new Icon(Icons.add_a_photo),
            //   title: new Text('permdsdsdds_camera_mic'),
            // )
            new Image.network('http://images.rednet.cn/articleimage/2018/09/28/1762360.png'),
            new Image.network('http://images.rednet.cn/articleimage/2018/09/28/1762360.png'),
            new Image.network('http://images.rednet.cn/articleimage/2018/09/28/1762360.png'),
          ],
        ),
      )
    );
  }
}
// p10-   img
class MyApp2 extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demoxxxx',
      home: Scaffold(
        body: Center(
          child: new Container(
            width: 300.0,
            height: 400.0,
            color: Colors.lightBlueAccent,
            child: Container(
              child: new Image.network(
                'http://images.rednet.cn/articleimage/2018/09/28/1762360.png',
                repeat: ImageRepeat.repeatX,
                // fit: BoxFit.contain),
                // modulate 常用，（调整，调节的意思）
                // colorBlendMode: BlendMode.modulate,
              )
            ),
          )
        )
      )
    );
  }
}
// 第一个组件，Container，第二季前9节内容
class MyApp1 extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demoxxxx',
      home: Scaffold(
        body: Center(
          child: Container(
            child: new Text('hello Flutter', style: TextStyle(fontSize: 40.0)),
            alignment: Alignment.topLeft,
            width: 300.0,
            height: 400.0,
            // color: Colors.cyan,
            padding: const EdgeInsets.fromLTRB(10.0, 200.0, 0, 0),
            margin: const EdgeInsets.fromLTRB(0, 200.0, 0, 0),
            // color就是背景，Container中decoration就是渐变背景，不能共存
            decoration: BoxDecoration(
              gradient: const LinearGradient(
                colors: [Colors.cyan, Colors.lightBlue, Colors.lightGreen]
              ),
              border: Border.all(width: 5.0, color: Colors.redAccent)
            ),
          ),
        )
      )
    );
  }
}
